import request from '../utils/request';
import qs from 'qs';

export async function fetchCategory() {
	return request('/ecs/goods/category.action', {
		headers: {
	      'Content-Type': 'application/x-www-form-urlencoded'
		}
	})
}

export async function fetchBrandList() {
	return request('/ecs/brand/list.action', {
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	})
}

export async function fetchShopInfo(searchParam) {
	return request(`/ecs/goods/list.action?${qs.stringify(searchParam, {arrayFormat: 'brackets'})}`, {
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	})
}

export async function fetchMembers(searchParam) {
	return request(`/ecs/user/myinvite.action?${qs.stringify(searchParam, {arrayFormat: 'brackets'})}`, {
		headers: {
			'Content-Type': 'application/json'
		}
	})
}